/**
 * @author monirul
 */

var RoomHistoryModel =  new Class.create({
	
	initialize: function(){
		this._roomHistoryList = {};
	},
	
	init:function(o){
		if(o['roomHistoryList'] != null){
			this._roomHistoryList = o['roomHistoryList'];
		}
		this.roomHistoryUpdated = new Event(this);
	},
	
	showRoomHistory: function(roomHistoryList) {
		this._roomHistoryList = roomHistoryList;
		this.roomHistoryUpdated.notify({'roomHistoryList': this._roomHistoryList});
	},
	
	getRoomHistory:function(){
		return this._roomHistoryList;
	},
	
	getRoomGameHistory:function(gameId){
		for(var i=0;i<this._roomHistoryList.length; i++){
			if(this._roomHistoryList[i].historyId == gameId){
				return this._roomHistoryList[i].gameHistoryDetailList; 
			}
		}
		return null;
		
	}
	
	
	
});
